<?php

/**
 * USUARIO form base class.
 *
 * @method USUARIO getObject() Returns the current form's model object
 *
 * @package    dietas
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseUSUARIOForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'nombre'         => new sfWidgetFormInputText(),
      'apellido'       => new sfWidgetFormInputText(),
      'fecha_nac'      => new sfWidgetFormDate(),
      'email'          => new sfWidgetFormInputText(),
      'altura'         => new sfWidgetFormInputText(),
      'sexo'           => new sfWidgetFormInputText(),
      'cintura'        => new sfWidgetFormInputText(),
      'cuello'         => new sfWidgetFormInputText(),
      'cadera'         => new sfWidgetFormInputText(),
      'tipo_actividad' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('TIPO_ACTIVIDAD'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'nombre'         => new sfValidatorString(array('max_length' => 100)),
      'apellido'       => new sfValidatorString(array('max_length' => 100)),
      'fecha_nac'      => new sfValidatorDate(),
      'email'          => new sfValidatorString(array('max_length' => 100)),
      'altura'         => new sfValidatorNumber(),
      'sexo'           => new sfValidatorInteger(),
      'cintura'        => new sfValidatorNumber(),
      'cuello'         => new sfValidatorNumber(),
      'cadera'         => new sfValidatorNumber(),
      'tipo_actividad' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('TIPO_ACTIVIDAD'))),
    ));

    $this->widgetSchema->setNameFormat('usuario[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'USUARIO';
  }

}
